import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home.vue'

Vue.use(Router);

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'home',
            component: () => import('./views/home.vue')
        },
        {
            path: '/about.html',
            name: 'about',
            component: () => import('./views/about.vue')
        },
        {
            path: '/gbook.html',
            name: 'gbook',
            component: () => import('./views/gbook.vue')
        },
        {
            path: '/share.html',
            name: 'share',
            component: () => import('./views/share.vue')
        },
        /**
         * 带id
         */
        {
            path: '/info.html/:id',
            name: 'info',
            component: () => import('./views/info.vue')
        },
        {
            path: '/infopic.html/:id',
            name: 'infopic',
            component: () => import('./views/infopic.vue')
        },
        /**
         * 带分类，不带分类的
         */
        {
            path: '/list.html',
            name: 'list',
            component: () => import('./views/list.vue')
        },
        {
            path: '/list.html/:sort_id',
            name: 'listById',
            component: () => import('./views/list.vue')
        },
        /**
         * 写或者添加，修改页面
         */
        {
            path: '/new_article.html',
            name: 'new_article',
            component: () => import('./views/new_article.vue')
        },
        /**
         * 这个修改，不确定是否使用，目前用页面传值方式，暂时不用重新通过id，获取文章方式
         */
        {
            path: '/new_article.html/:id',
            name: 'article_fx',
            component: () => import('./views/new_article.vue')
        }
    ]
});
